#ifndef __TASK_LCDSHOW_H__
#define __TASK_LCDSHOW_H__

//? 最大设置频率 
#define CYCLELIMITMAX 5000

//? 最小设置频率
#define CYCLELIMITMIN 1000

void displayLeader(unsigned char show);

void displayFrequency(unsigned short y, unsigned int frequency);

void displayQueueMemberMessage(unsigned char num, unsigned char symbol, unsigned short numberData);
void displayQueueMessage(unsigned char num, unsigned char symbol, unsigned short numberData);

void setFrequencyEncod(unsigned char digit);
unsigned int setCodingIncrease(unsigned int getNLaserCodDig , unsigned int getNTempLaser);
unsigned int setCodingReduction(unsigned int getNLaserCodDig , unsigned int getNTempLaser);
//void FrequencyShow(unsigned short frequency);

void DisPlay_CardNumQueueMemberMessage(unsigned char num , unsigned char symbol , unsigned short numberData);

void DisPlayShowleader(unsigned char show);


//void DisPlayShowQueueForTimeDiffMessage(unsigned short nCoding , unsigned char Num);
void DisPlay_CardNumQueueMessage(unsigned char num , unsigned char symbol , unsigned short numberData);

void DisPlayShowQueueForFrequencyMessage(unsigned short Num , unsigned short nCoding);
unsigned char MemberFrequencyMessage(unsigned int nCoding , unsigned short nxdata , unsigned short nydata);
unsigned char DisPlayShowCaptaiDiffMemberTime(unsigned short nCoding , unsigned short nxdata , unsigned short nydata);
void DisPlayShowQueueForTimeDiffMessage(unsigned short Num , unsigned short nCoding);
/// @brief 显示队长的周期时间
/// @param nCoding 
unsigned char DisPlayShowCaptaiCycle(unsigned int nCoding);

/// @brief 显示与队长的差距时间
/// @param diff 
unsigned char  DisPlayShowCaptaiTimeDiff(unsigned short diff);

/// @brief 修改前的频率显示,6位数据
/// @param nCoding 
/// @return 
unsigned char funFrequencyNumberSet(unsigned int nCoding);

/// @brief 编号显示
/// @param num 
void DisPlay_CardNum(unsigned char num);

/// @brief LCD显示,修改后的频率
/// @param nCoding 
/// @return 
unsigned char FrequencyReadingShow(unsigned int nCoding);

/// @brief 修改后的频率显示,4位数据
/// @param nCoding 
/// @return 
unsigned char FrequencySettingShow(unsigned int nCoding);
// 定义结构体，包含位数和每一位数字
typedef struct {
    int digits[10];  // 数组存储每一位数字，最大 10 位
    int count;       // 位数
} DigitInfo;
extern DigitInfo extractDigits(unsigned int num);
int getDecimalDigits(unsigned int num);

#endif 